package com.hujing.exception;

public class ExceptionDemo2 {

    public static void main(String[] args) {
        try {
            calc();
        } catch (ArithmeticException e) {
            e.printStackTrace();
        }
        System.out.println("End of program");
    }

    /**
     * 使用throws关键字将异常抛出,由调用者对异常进行处理
     * @return
     * @throws ArithmeticException
     */
    public static int calc() throws ArithmeticException{
        int a = 10;
        int b = 0;
        return a /b;
    }
}
